# coding:utf-8
import redis

class Config(object):
    '''配置信息'''
    SECRET_KEY = "dsfsdfsdf54sdfsad "

    # 数据库
    SQLALCHEMY_DATABASE_URI = 'mysql://root:root@127.0.0.1:3306/ihome_python04'
    SQLALCHEMY_TRACK_MODIFICATIONS = True

    # redis
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = "6379"

    # flask-session配置
    SESSION_TYPE = 'redis'
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True  # 对cookie中session_id进行隐藏处理
    PERMANENT_SESSION_LIFETIME = 86400  # session数据的有效期，单位秒

class Developmentconfig(Config):
    """开发模式的配置信息"""
    # 开启调试模式：DEBUG=true，控制log日志地等级会失效
    DEBUG = True

class ProductionConfig(Config):
    """生产环境配置信息"""
    pass


config_map = {
    'develop': Developmentconfig,
    'product': ProductionConfig
}


















